package patternmining.model.construction;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;

/**Container class.
 * 
 * A instance of ModelData encapsulates the set of data that shall constitute the model of a Java Project or a BPSL Specification
 * 
 * The data is given by the set of term items and atom items represented by the model
 * Constructing the graph that materializes the model every term item may become a vertex
 * and every atom item may become a edge.
 * 
 * The disjunction of the tem and atom items constitutes a BPSL formula.
 * 
 *  
 * @see ModelGraphBuilder;
 * @version 1.0, 09.05.2008
 * @author Holger Wiehen
 */
class ModelData {

    private List<TermData> termList;
    private List<AtomData> atomList;

    public ModelData(){
        termList = new LinkedList<TermData>();
        atomList = new LinkedList<AtomData>();
    }
    
    public void addModelData(ModelData otherModelData){
        termList.addAll(otherModelData.termList);
        atomList.addAll(otherModelData.atomList);
    }
    
    public void addTermData( TermData termData){
        this.termList.add(termData);
    }
    
    
    public void addAtomData(AtomData atomData){
        atomList.add(atomData);
    }
    
    public Iterator<TermData> termDataIterator(){
        return termList.iterator(); 
    }
    
    public Iterator<AtomData> atomDataIterator(){
       return atomList.iterator(); 
    }
    
    private List<TermData> termData(){
        return termList;
    }
   
    private List<AtomData> atomData(){
        return atomList;
    }
    
}
